fix: replace deprecated node FS prop W-19160014#1607
Conversation
| .map((file) => ({ | ||
| name: file.name, | ||
| registry: JSON.parse(fs.readFileSync(path.join(file.path, file.name), 'utf-8')) as MetadataRegistry, | ||
| registry: JSON.parse(fs.readFileSync(path.join(file.parentPath, file.name), 'utf-8')) as MetadataRegistry, |
There was a problem hiding this comment.
the previous path prop was deprecated in node v18,20 and 21 then removed in v24:
https://nodejs.org/docs/latest-v22.x/api/fs.html#direntpath
parentPath is supported on node >= 18.20.0 so it's safe to use
| @@ -1,4 +1,5 @@ | |||
| { | |||
| "devDepOverrides": ["mocha"], | |||
There was a problem hiding this comment.
mocha v10 has a bug when loading TS files via a node loader:
mochajs/mocha#5314
after fixing the types in SDR we still get those wrong warnings:

this change overrides the version of mocha provided by dev-scripts so we can use mocha v11 here, see:
https://github.com/forcedotcom/dev-scripts/?tab=readme-ov-file#config-file-notes
related:
oclif/core#1416
| "access": "public" | ||
| }, | ||
| "resolutions": { | ||
| "@types/node": "18.19.123" |
There was a problem hiding this comment.
we bumped these types in dev-script: forcedotcom/dev-scripts#388
but there's another @types/node for node v20 coming as a peerDep from commitlint deps, we'll override it here as a workaround until we drop node v18.
What does this PR do?
Fixes issues blocking tests from being run in node v24:
@W-19160014@